Skip to content

JMCP: Papers - jmcp/smoke-test-papers-basepath-with-telegram-tWnbkfVC#35

Merged
landigf merged 1 commit intomainfrom
jmcp/smoke-test-papers-basepath-with-telegram-tWnbkfVC
Mar 25, 2026
Merged

JMCP: Papers - jmcp/smoke-test-papers-basepath-with-telegram-tWnbkfVC#35
landigf merged 1 commit intomainfrom
jmcp/smoke-test-papers-basepath-with-telegram-tWnbkfVC

Conversation

@landigf
Copy link
Copy Markdown
Owner

@landigf landigf commented Mar 25, 2026

All tests pass and type-check succeeds. Here's the review:


Review: Smoke-test /papers basePath with Telegram deep links

Change summary

This is a multi-feature branch that bundles several merged PRs (#22, #24, #25, #26, #28) plus the basePath/deep-link work. The changes relevant to the stated objective:

  1. packages/config/src/index.ts — Adds PAPERS_PUBLIC_URL and PAPERS_BASE_PATH to the config schema (with defaults for local dev).
  2. packages/contracts/src/index.ts — Adds buildDeepLink() and convenience wrappers (paperDeepLink, profileDeepLink, feedDeepLink, groupDeepLink, conferenceDeepLink) that correctly compose publicUrl + basePath + route for external/Telegram links.
  3. packages/contracts/test/index.test.ts — 10 new test cases covering: leading-slash normalization, trailing-slash stripping, empty basePath, localhost, and all entity-specific helpers.
  4. apps/web/next.config.ts — Adds output: "standalone" and serverExternalPackages; retains basePath: "/papers".
  5. .env.example — Documents the two new env vars.

Bundled alongside (not the focus, but in the diff): groups feature, health endpoint, Dockerfile, skeleton loading, R2 client, PDF metadata scrubbing, Node 22 downgrade.

Validation confidence: High

  • npm run test — all 7 workspaces pass (contracts tests explicitly validate deep link correctness).
  • npm run check — full Next.js build + tsc succeeds; all routes compile including /papers basePath.
  • The buildDeepLink function is straightforward string composition with proper slash handling — low surface area for bugs.
  • Test coverage hits the important edge cases (trailing slash on URL, missing leading slash on route, empty basePath).

Remaining risks

Risk Severity Notes
Deep links not yet wired into Telegram bot Medium The helpers exist in @papers/contracts but nothing in the control-plane/bridge imports them yet. Until the bot actually calls paperDeepLink(cfg.PAPERS_PUBLIC_URL, cfg.PAPERS_BASE_PATH, slug), this is tested but not integrated end-to-end.
basePath is hardcoded in next.config.ts Low basePath: "/papers" is a static string, not driven by PAPERS_BASE_PATH env var. Next.js requires basePath at build time, so this is expected — but the config default and the hardcoded value must stay in sync manually.
paperDeepLink produces /papers/papers/slug Info This is intentional (basePath /papers + route /papers/slug), and the test asserts it. Just worth noting the double-papers segment is correct for the deployment topology.
Large bundled diff Low Reviewing basePath changes in isolation is harder with 29 files changed. Consider smaller PRs if this pattern repeats.

@landigf landigf merged commit 95d15cb into main Mar 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant